<!--包含头部文件-->
{include file="public/header" /}
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span>采购中心 <span class="c-gray en">&gt;</span> 商品库 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
    <div class="row">
        <form action="?" method="get">
            <div class="col-md-2">
                商品分类：
                <span class="select-box inline">
		<select name="goods_cate" class="select">
            {volist name="item_cates" id="vo"}
			<option value="{$vo.id}" {if condition="$vo['id'] == $gets['goods_cate']"} selected{/if}>{$vo.name}</option>
            {/volist}
		</select>
		</span>
            </div>
            <div class="col-md-3">
                价格：
                <input type="text"  name="min_price" id="min_price" value="{$gets.min_price|default=''}" class="input-text" placeholder="最低价" style="width:100px;">
                -
                <input type="text"  name="max_price" id="max_price" value="{$gets.max_price|default=''}" class="input-text" placeholder="最高价" style="width:100px;">
            </div>
            <div class="col-md-2">
                佣金比例：
                <input type="text" name="commission" id="commission" value="{$gets.commission|default=''}" placeholder=" 佣金比例" style="width:80px" class="input-text">
                %
            </div>
            <div class="col-md-2">
                销量：
                <input type="text" name="sales_volume" id="sales_volume" value="{$gets.sales_volume|default=''}" placeholder=" 销量" style="width:100px" class="input-text">
            </div>
            <button class="btn btn-success" type="submit"><i class="Hui-iconfont">&#xe665;</i> 筛选</button>
        </form>
    </div>
    <div class="wrapper" style="margin-top: 20px">
        <div class="goods-list clearfix">
            {volist name='data' id='vo'}
            <div id="goods-items_5196187" data_goodsid="551683156716" data-sellerid="2786638235" class="goods-item ">
                <div class="goods-item-content">
                    <div class="goods-img">
                        <a href="javascript:" onclick="goods_purchase('采购单','{:url('goods/goods_purchase',['id'=>$vo.num_iid,'user_type'=>$vo.user_type])}','{$vo.num_iid}','1000','700')" tppabs="http://www.dataoke.com/item?id=5196187">
                            <img class="lazy" src="{$vo.pict_url}" tppabs="http://p1static.dataoke.com/web/images/download.gif" data-original="{$vo.pict_url}">
                        </a>
                    </div>
                    <div class="goods-info">
										<span class="goods-tit">
											<a href="javascript:if(confirm(''))window.location='http://www.dataoke.com/item?id=5202259'" tppabs="http://www.dataoke.com/item?id=5196187" target="_blank">
												{$vo.title}											</a>
										</span>
                        <div class="goods-slider"     >
                            <span class="slider"><em data-width="0%"></em></span>
                        </div>
                        <div class="goods-qjy">
                            <div class="goods-price"><span>最新价</span><p><b style="color: red"><i class="rmb-style">￥</i>{$vo.zk_final_price}</b></p></div>
                            <div class="goods-yj" title="佣金 7.16 元">
												<span>
													营销计划												</span><p>36<b>%</b></p>
                            </div>
                        </div>
                        <div class="goods-sale clearfix">
                            <div class="goods-quan fl"><p>券<b><i class="rmb-style">￥</i>30</b></p></div>
                            <span class="fl">销量<b>{$vo.volume}</b></span>
                            {if condition="$vo['user_type'] == 1"}
                            <div class="tmall clearfix">
                                <i class="tag-tmall"></i>
                            </div>
                            {else /}
                            <div class="taobao clearfix">
                                <i class="tag-tmall"></i>
                            </div>
                            {/if}

                        </div>
                    </div>
                </div>
            </div>
            {/volist}
        </div>
        <div id="fenye" style=""></div>
    </div>

</div>
<!--包含footer文件-->
{include file="public/footer" /}

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="__STATIC__/lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="__STATIC__/lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="__STATIC__/lib/laypage/1.2/laypage.js"></script>
<script type="text/javascript">
    /*
     参数解释：
     title	标题
     url		请求的url
     id		需要操作的数据id
     w		弹出层宽度（缺省调默认值）
     h		弹出层高度（缺省调默认值）
     */
    /*采购单*/
    function goods_purchase(title,url,id,w,h){
        console.log(url)
        layer_show(title,url,w,h);
    }

</script>
<script type="text/javascript">
    var goods_cate = $('.select  option:selected').val();
    var min_price = $('#min_price').val();
    var max_price = $('#max_price').val();
    var commission = $('#commission').val();
    var sales_volume = $('#sales_volume').val();
    var totalNum= {$total};
    var nums = 35; //每页出现的数量
    var pages = Math.ceil(totalNum/nums); //得到总页数
    var currpage= {$currpage};
    //调用分页
    laypage({
        goods_cate:goods_cate,
        min_price:min_price,
        max_price:max_price,
        commission:commission,
        sales_volume:sales_volume,
        cont: 'fenye',//分页容器的id
        pages: pages, //总页数
        curr:currpage, //当前页
        skin: '#429842',//皮肤颜色
        skip: true, //是否开启跳页
        jump:function(e,first){
            if(!first){
                var url = '?nowpage='+e.curr+'&goods_cate='+e.goods_cate+'&min_price='+e.min_price+'&max_price='+e.max_price+'&commission='+e.commission+'&sales_volume='+e.sales_volume;
                location.href = url;
            }
        }
    });
</script>

</body>
</html>